<script>
    // setTimeout(function () {
    //     console.log('timeout')
    // }, 0)
    // console.log(3)
    // )

    // console.log(8)

    const promise = new Promise((resolve, reject) => {
        console.log('promise pending')
        setTimeout(() => resolve('第一个promise'), 3000)
    })
        .then(
            value => {
                console.log(value)

                return new Promise((resolve, reject) => {
                    setTimeout(() => resolve('第二个promise'), 3000)
                })
            },
            error => {
                console.log(`Fail:${error}`)
            }
        )
        .then(value => {
            console.log(value)
        })
    console.log(5)
</script>
